QT       += core multimedia

#greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

win32: {
    INCLUDEPATH += $$PWD/ffmpeg/win/include
    LIBS += -L$$PWD/ffmpeg/win/bin -lavformat -lavcodec -lavfilter -lavutil -lpostproc -lswresample -lswscale

    SOURCES += \
        render/WinAudioRender.cpp \
        capture/win/WinMediaDevice.cpp \
        capture/win/WinMicRecord.cpp \
        capture/win/WinSpeakerRecord.cpp

    HEADERS += \
        render/WinAudioRender.h \
        capture/win/WinMediaDevice.h \
        capture/win/WinMicRecord.h \
        capture/win/WinSpeakerRecord.h

    # 录音必要lib
    LIBS += -lole32 -lAvrt
}

macx: {
    SOURCES += \
        capture/mac/MacMediaDevice.mm \
        capture/mac/MacMicRecord.mm

    HEADERS += \
        capture/mac/MacMediaDevice.h \
        capture/mac/MacMicRecord.h


    INCLUDEPATH += $$PWD/ffmpeg/mac/include
    LIBS += -L$$PWD/ffmpeg/mac/bin -lavformat.57 -lavcodec.57 -lavfilter.6 -lavutil.55 -lpostproc.54 -lswresample.2 -lswscale.4

    LIBS += -framework AudioToolbox \
            -framework CoreAudio \
            -framework CoreFoundation
}

SOURCES += \
    common/AVAudioConvert.cpp \
    common/AVVideoConvert.cpp \
    common/LoopBuffer.cpp \
    encode/AVFileStoreAAC.cpp \
    encode/AVFileStoreAbstract.cpp \
    encode/AVFileStoreMP3.cpp \
    AudioDataDispatcher.cpp \
    MediaDevice.cpp \
    RecordManager.cpp \
    main.cpp

HEADERS += \
    common/AVAudioConvert.h \
    common/AVVideoConvert.h \
    common/AudioParam.h \
    common/LoopBuffer.h \
    encode/AVFileStoreAAC.h \
    encode/AVFileStoreAbstract.h \
    encode/AVFileStoreMP3.h \
    AudioDataDispatcher.h \
    MediaDevice.h \
    RecordManager.h \

win32:CONFIG(release, debug|release){
    QMAKE_POST_LINK += xcopy $$system_path($$PWD/ffmpeg/win/bin/*.dll) $$system_path($$OUT_PWD/release) /y &
}

win32:CONFIG(debug, debug|release){
    QMAKE_POST_LINK += xcopy $$system_path($$PWD/ffmpeg/win/bin/*.dll) $$system_path($$OUT_PWD/debug) /y &
}

FORMS +=

#LIBS += -lWlanapi
#LIBS += -ladvapi32
#LIBS += -lUser32
#LIBS += -lkernel32 -lwinspool -lcomdlg32 -lshell32 -loleaut32 -luuid

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
